﻿namespace ElegantRoute.Routing {
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Routing;
    using System.Web.Mvc;

    public static class ElegantRouteExtensions {
        public static ElegantRoute MapElegantRoute(this RouteCollection routes, string name, string url, object defaults) {
            var route = new ElegantRoute(url,
                new RouteValueDictionary(defaults),
                new RouteValueDictionary(), //constraints
                new RouteValueDictionary(), //dataTokens
                new MvcRouteHandler());
            routes.Add(name, route);
            return route;
        }
    }
}